/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package assignment_cp3120.manager.editflights;

import assignment_cp3120.DAO.Factory.DAOFactory;
import assignment_cp3120.dataObjects.AllFlights;
import assignment_cp3120.dataObjects.Flight;
import assignment_cp3120.manager.createflights.CreateFlightsModel;

/**
 *
 * @author Administrator
 */
public class EditFlightsModel extends CreateFlightsModel{
    private Flight editingFlight;

    public EditFlightsModel() {
        editingFlight = new Flight();
    }
    public Flight getEditingFlight() {
        return editingFlight;
    }
    public void setEditingFlight(Flight flight) {
        editingFlight = flight;
    }
    public void deleteEditFlight() {
        DAOFactory.getDAOFactory().getFlightDAO().deleteFlight(editingFlight.getFlight_id());
        AllFlights.remove(editingFlight);
    }
}